#ifndef WIDGET_H
#define WIDGET_H

#include <QTcpSocket>
#include <QWidget>

QT_BEGIN_NAMESPACE
namespace Ui { class Widget; }
QT_END_NAMESPACE

class Widget : public QWidget
{
    Q_OBJECT

public:
    Widget(QWidget *parent = nullptr);
    ~Widget();

private slots:
    void on_btnCon_clicked();

    void mRead_Data_From_serve();

    void on_btnSend_clicked();

    void on_btnDiscon_clicked();

    void onConnected();

    void onError(QAbstractSocket::SocketError );

    void onTimeOut();
private:
    Ui::Widget *ui;
    QTcpSocket* client;
    QTimer* timer;

    void setInsertColor(Qt::GlobalColor color, QString str);
};
#endif // WIDGET_H
